/**
 * 项目名称: Topic_111.cpp
 * 项目路径: study/DataStructure/LeetCode/树/简单
 * 编辑时间: 2024年08月07日09时56分01秒
 * 用   户: 轻尘
 */

#include <bits/stdc++.h>

using namespace std;

struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;

    TreeNode() : val(0), left(nullptr), right(nullptr) {}

    TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}

    TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
};

class Solution {
public:
    int ans = 1000010;
    queue<TreeNode *>q;
    void Order(TreeNode *root, int cnt) {
        int tmp = cnt;
        if(root->left || root->right)tmp++;
        if (root->left) {
            Order(root->left, tmp);
        }
        if (root->right) {
            Order(root->right, tmp);
        }

        if (!root->left && !root->right) {
            cout<<root->val <<" " << ans << " " << cnt << endl;
            ans = min(ans, cnt);
        }
    }

    int minDepth(TreeNode *root) {
        if (!root)return 0;
        Order(root, 1);
        return ans;
    }
};

int main() {

    return 0;
}
